#include "Logger.hpp"

Logger* Logger::instance = 0;

Logger* Logger::getInstance(){
    return Logger::instance;
};

Logger::Logger(){
    Logger::curPriority = 0;
	pool.createPool(4096);
}

Logger& Logger::operator<<(const char* str){
	if (pool.copy(strlen(str), (void*)str)){
        return *Logger::instance;
	} else {
        write();
		pool.clear();
	}
}

void Logger::close(){
    write();
}